{{csrf_field()}}


<div class="layui-form-item layui-col-md6">
    <label for="" class="layui-form-label">姓名</label>
    <div class="layui-input-block">
        <input type="text" name="realname" value="{{ $data->realname ?? '' }}" lay-verify="required" placeholder="请输入姓名"
               class="layui-input">
    </div>
</div>

<div class="layui-form-item layui-col-md6">
    <label for="" class="layui-form-label">性别</label>
    <div class="layui-input-block">
        <input type="radio" name="sex" value="1" title="男" checked>
        <input type="radio" name="sex" value="2" title="女" {{(isset($data) && $data->sex == 2) ? 'checked' : ''}} >
    </div>
</div>

<div class="layui-form-item layui-col-md6">
    <label for="" class="layui-form-label">部门</label>
    <div class="layui-input-block">
        <select name="department" lay-verify="required" lay-filter="ajax-department" lay-search="" id="ajax-department"
                data-url="{{route('ajax_department')}}" data-code="{{$data->department ?? ''}}">
        </select>
    </div>
</div>

<div class="layui-form-item layui-col-md6">
    <label for="" class="layui-form-label">职位</label>
    <div class="layui-input-block">
        <select name="position" lay-verify="required" lay-filter="ajax-position" lay-search="" id="ajax-position"
                data-url="{{route('ajax_position')}}" data-code="{{$data->position ?? ''}}"
                data-fcode="{{$data->department ?? ''}}">
        </select>
    </div>
</div>

<div class="layui-form-item layui-col-md6">
    <label for="" class="layui-form-label">手机号</label>
    <div class="layui-input-block">
        <input type="text" name="phone" value="{{ $data['phone'] ?? '' }}" lay-verify="required" placeholder="请输入手机号"
               class="layui-input">
    </div>
</div>


<div class="layui-form-item">
    <label for="" class="layui-form-label">状态</label>
    <div class="layui-input-block">
        <input type="checkbox" name="status" lay-skin="switch" value="1" lay-text="在职|离职"
               @if( !isset($data['status']) || $data['status'] != 2 ) checked @endif >
    </div>
</div>


<div class="layui-form-item layui-col-md6">
    <label for="" class="layui-form-label">Open ID</label>
    <div class="layui-input-block">
        <input type="text" name="openid" value="{{ $data['openid'] ?? '' }}" lay-verify="required" placeholder="请输入OpenID"
               class="layui-input">
    </div>
</div>


<div class="layui-form-item">
    <div class="layui-input-block">
        {{isset($data) ? method_field('PUT') : ''}}
        {{csrf_field()}}
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="layui-form-submit">确 认</button>
        <a class="layui-btn" href="{{route('staff.index')}}">返 回</a>
    </div>
</div>

